<html>

<head>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>html5的练习题</title>
</head>

<body>
    <canvas id="myCanvas" width="512" height="480" style="border:1px solid #d3d3d3;;">
    </canvas>
    <script type="text/javascript">
    var c = document.getElementById("myCanvas");
    var ctx = c.getContext("2d");
    // 背景图片
    var bgReady = false;
    var bgImage = new Image();
    bgImage.onload = function() {
        bgReady = true;
    };
    bgImage.src = "images/background.png";
    </script>
</body>

</html>
